package org.szy.plugin.dev.param;

import cn.hutool.core.util.StrUtil;

/**
 * 开发_文件查询参数
 *
 * @author wangbuhao
 * @since 2023-06-28 18:17:40
 **/
public class DevFileQueryParam {

    /**
     * 列字段
     */
    private String columnField;

    /**
     * 关联表名称
     */
    private String applyTo;
    private String applyToIn;

    /**
     * 关联表标识
     */
    private Integer refNum;
    private String refNumIn;

    /**
     * 类别
     */
    private String category;
    private String categoryIn;

    /**
     * 文件原始名称
     */
    private String originalName;


    public boolean validator() {
        return (StrUtil.isAllEmpty(this.getApplyTo(), this.getApplyToIn()
                , this.getRefNumIn()
                , this.getCategory(), this.getCategoryIn()) && this.getRefNum() == null);
    }

    public boolean validatorRef() {
        return StrUtil.isEmpty(this.getRefNumIn()) && this.getRefNum() == null;
    }

    public boolean validatorApp(String applyTo) {
        return (this.applyTo != null && this.applyTo.equals(applyTo)) || (this.applyToIn != null && this.applyToIn.contains(applyTo));
    }

    public boolean validatorCategory(String category) {
        return (this.category != null && this.category.equals(category)) || (this.categoryIn != null && this.categoryIn.contains(category));
    }

    public String getColumnField() {
        return columnField;
    }

    public void setColumnField(String columnField) {
        this.columnField = columnField;
    }

    public String getApplyTo() {
        return applyTo;
    }

    public void setApplyTo(String applyTo) {
        this.applyTo = applyTo;
    }

    public String getApplyToIn() {
        return applyToIn;
    }

    public void setApplyToIn(String applyToIn) {
        this.applyToIn = applyToIn;
    }

    public Integer getRefNum() {
        return refNum;
    }

    public void setRefNum(Integer refNum) {
        this.refNum = refNum;
    }

    public String getRefNumIn() {
        return refNumIn;
    }

    public void setRefNumIn(String refNumIn) {
        this.refNumIn = refNumIn;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getCategoryIn() {
        return categoryIn;
    }

    public void setCategoryIn(String categoryIn) {
        this.categoryIn = categoryIn;
    }

    public String getOriginalName() {
        return originalName;
    }

    public void setOriginalName(String originalName) {
        this.originalName = originalName;
    }
}
